{% extends 'base.html' %}
 {% block bar %}
      <div class="col-md-9" style=  "justify-content: flex-end;">
            <h1 class="page-header">客户管理页面</h1>
            <div class="panel panel-primary">
                <!-- Default panel contents -->
                <div class="panel-heading">客户列表 <i class="fa fa-thumb-tack pull-right"></i></div>
                <div class="panel-body">
                    <form action="">
                        <div class="row" style="margin-bottom: 15px">
                        <div class="col-md-4">
                            <div class="input-group">
                                <input type="text" class="form-control" placeholder="Search for...">
                                <span class="input-group-btn">
                                    <button class="btn btn-default" type="button">搜索</button>
                                </span>
                            </div><!-- /input-group -->
                        </div><!-- /.col-md-4 -->
                    </form>

                        <div class="col-md-2 pull-right">
                            <a class="btn btn-success" href="/gold/add_customer">新增客户</a>
                        </div>
                </div>
                </div>
 {% endblock %}
{% block main%}
    <div class="container-fluid">
    <div class="row-fluid">
    <div class="span12">

    <table border="1" class = "table table-hover table-bordered">
       <thead>
    <tr>
        <th>序号</th>
        <th>订单时间</th>
        <th>订单号</th>
        <th>客户姓名</th>
        <th>客户电话</th>
        <th>地址</th>
        <th>成交金额</th>
        <th>定金</th>
        <th>余款</th>
        <th>量尺</th>
        <th>送货</th>
        <th>送货时间</th>
        <th>结清状态</th>
        <th>备注</th>
        <th>操作</th>

    </tr>
    </thead>
 <tbody>
    {% for customer_obj in customer_list  %}
        <tr>
        <td>{{ forloop.counter }}</td>
        <td>{{ customer_obj.order_time}}</td>
        <td ><a href="/gold/order_list?id={{ customer_obj.id }}">{{ customer_obj.order_num }}</a></td>
        <td>{{ customer_obj.customer_name }}</td>
        <td>{{ customer_obj.customer_phone }}</td>
        <td>{{ customer_obj.customer_adr }}</td>
        <td>{{ customer_obj.deal_money }}</td>
        <td>{{ customer_obj.deposit_money }}</td>
        <td>{{ customer_obj.rest_money }}</td>
        <td>
            {% if customer_obj.ruler_flag == 0 %}
            未量尺
            {% else %}
            已量尺
            {% endif %}


        </td>
        <td>
            {% if customer_obj.delivery_flag == 0 %}
            未送货
            {% else %}
            已送货
            {% endif %}
        </td>
        <td>{{ customer_obj.delivery_time }}</td>
        <td>
             {% if customer_obj.clean_status == 0 %}
            未结清
            {% else %}
            已结清
            {% endif %}


        </td>
        <td>{{ customer_obj.remarks }}</td>
        <td>
             <a href="/gold/update_customer?id={{ customer_obj.id }}">修改</a>

        </td>
 </tr>
  {% endfor %}
</tbody>
</table>
{% endblock %}

